import { RouteRecordName } from 'vue-router'

//对象转map
export function objConvertMap(obj: any, map: Map<RouteRecordName, RouteRecordName[]>) {
  for (const key in obj) {
    map.set(key, obj[key])
  }
  return map
}

//map转为json
export function mapConvertObj(map: Map<RouteRecordName, RouteRecordName[]>) {
  const obj: Record<string, any> = {}
  for (const [k, v] of map) {
    // @ts-ignore
    obj[k] = v
  }
  return obj
}
